package com.ykht.proj.coupon.Enum;

public enum SearchTypeEnum {
	// 搜索类型: 0全部 1品牌 2门店 3精选内容(cms文章)
	whole(0,"全部"),
	brand(1,"品牌"),
	shop(2,"门店"),
	cms(3,"精选内容");

	private Integer value;
	private String desc;

	private SearchTypeEnum(Integer value, String desc) {
		this.value = value;
		this.desc = desc;
	}


	/**
	 * 根据val值获取desc
	 * @param val 1、0
	 * @return
	 */
	public static String getDescByVal(Integer val) {
		SearchTypeEnum[] values = SearchTypeEnum.values();
		for (SearchTypeEnum oe : values) {
			if (oe.getValue().equals(val)) {
				return oe.getDesc();
			}
		}
		return null;
	}
	public static SearchTypeEnum getThisByVal(Integer val) {
		SearchTypeEnum[] values = SearchTypeEnum.values();
		for (SearchTypeEnum oe : values) {
			if (oe.getValue().equals(val)) {
				return oe;
			}
		}
		return null;
	}

	public Integer getValue() {
		return value;
	}

	public void setValue(Integer value) {
		this.value = value;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}
